<?php
include_once("header.php");
?>
<?php
if($_GET["opt"] == 1) {
	$email=$_GET["id"];
	if(empty($email)) {echo "<h2>Invalid user</h2>";}
	else {
	$delUser=mysql_query("DELETE FROM users WHERE email='$email'");
	$nDelUser=mysql_affected_rows();
		if($nDelUser > 0) {echo "<h2>User $email removed.</h2>";}
		else {echo "<h2>Error</h2>Please, try again.";}
	$delForwarding=mysql_query("DELETE FROM forwardings WHERE destination='$email'");
	}

include_once("footer.php"); die();
}
$email=$_GET["id"];
if(empty($email)){echo "<h2>Invalid user</h2>";}
else{
echo"
<h3>Delete user $email? (alias too)</h3>
<a href='?id=$email&opt=1'><img src='images/confirm_delete.png'></a>
";
}
?>
<br /><br />
<br /><br />
<?php
include_once("footer.php");
?>
